/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author stumbledog
 */
@Entity
@Table(name = "fantasyrosterperweek")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Fantasyrosterperweek.findAll", query = "SELECT f FROM Fantasyrosterperweek f"),
    @NamedQuery(name = "Fantasyrosterperweek.findById", query = "SELECT f FROM Fantasyrosterperweek f WHERE f.id = :id"),
    @NamedQuery(name = "Fantasyrosterperweek.findByFantasyPositionInRoster", query = "SELECT f FROM Fantasyrosterperweek f WHERE f.fantasyPositionInRoster = :fantasyPositionInRoster"),
    @NamedQuery(name = "Fantasyrosterperweek.findByType", query = "SELECT f FROM Fantasyrosterperweek f WHERE f.type = :type"),
    @NamedQuery(name = "Fantasyrosterperweek.findByDateTime", query = "SELECT f FROM Fantasyrosterperweek f WHERE f.dateTime = :dateTime")})
public class Fantasyrosterperweek implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 5)
    @Column(name = "fantasyPositionInRoster")
    private String fantasyPositionInRoster;
    @Size(max = 5)
    @Column(name = "type")
    private String type;
    @Column(name = "dateTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateTime;
    @JoinColumn(name = "playerId", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Nflplayer playerId;
    @JoinColumn(name = "weekId", referencedColumnName = "id")
    @ManyToOne
    private Week weekId;
    @JoinColumn(name = "teamId", referencedColumnName = "id")
    @ManyToOne
    private Fantasyteam teamId;

    public Fantasyrosterperweek() {
    }

    public Fantasyrosterperweek(Integer id) {
        this.id = id;
    }

    public Fantasyrosterperweek(Integer id, String fantasyPositionInRoster) {
        this.id = id;
        this.fantasyPositionInRoster = fantasyPositionInRoster;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getFantasyPositionInRoster() {
        return fantasyPositionInRoster;
    }

    public void setFantasyPositionInRoster(String fantasyPositionInRoster) {
        this.fantasyPositionInRoster = fantasyPositionInRoster;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Date getDateTime() {
        return dateTime;
    }

    public void setDateTime(Date dateTime) {
        this.dateTime = dateTime;
    }

    public Nflplayer getPlayerId() {
        return playerId;
    }

    public void setPlayerId(Nflplayer playerId) {
        this.playerId = playerId;
    }

    public Week getWeekId() {
        return weekId;
    }

    public void setWeekId(Week weekId) {
        this.weekId = weekId;
    }

    public Fantasyteam getTeamId() {
        return teamId;
    }

    public void setTeamId(Fantasyteam teamId) {
        this.teamId = teamId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Fantasyrosterperweek)) {
            return false;
        }
        Fantasyrosterperweek other = (Fantasyrosterperweek) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Fantasyrosterperweek[ id=" + id + " ]";
    }
    
}
